package my.test.groups.secondcommon;

import javax.swing.*;
import java.util.ArrayList;

/**
 * @Author 许玉康
 * @Date 2019/9/23 15:56
 */
public class Branch implements IBranch {

    //姓名
    private String name = "";
    //职位
    private String position = "";
    //薪水
    private int salary = 0;

    //领导下边有哪些下级领导和小兵
    ArrayList<ICorp> subordinate = new ArrayList<>();

    public Branch(String name, String position, int salary) {
        this.name = name;
        this.position = position;
        this.salary = salary;
    }

    @Override
    public void addSubordinate(ICorp corp) {
        this.subordinate.add(corp);
    }

    @Override
    public ArrayList<ICorp> getSubordinate() {
        return this.subordinate;
    }

    @Override
    public String getInfo() {
        return "名称:" + this.name + "\t职位:" + this.position + "\t薪水" + this.salary;
    }
}
